<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Magic Compass Alipay Barcode Merchant Demo</title>
<link href="<%=request.getContextPath()%>/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="<%=request.getContextPath()%>/resources/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
	<div class="page-header">
		<h1 class="text-center">Please Input customer purchase Information</h1>
	</div>
<br><br><br>
<c:url var="saveUrl" value="/merchant_demo/inputTransactionComplete" />
<form:form modelAttribute="merchantInputProductPageForm" method="POST" action="${saveUrl}">
	<table class="table table-bordered table-condensed table-striped">
		<thead>
			<tr>
		        <th>Product Name</th>
		        <th>Price</th>
		        <th>Quantity</th>
		     </tr>
        </thead>
        <tbody>
	        <c:forEach var="aProduct" items="${merchantInputProductPageForm.productList4Page}" varStatus="rowCount">
	        <tr>
	            <td>${aProduct.productName}</td>
	            <td>${aProduct.productPrice}</td>
	            <td>
	            	<div class="col-xs-2">
		            	<input type="text" name="productList4Page[${rowCount.index}].quantity" value="${aProduct.quantity}" class="form-control input-small" >
		            	<input type="hidden" name="productList4Page[${rowCount.index}].productId" value="${aProduct.productId}">
		            	<input type="hidden" name="productList4Page[${rowCount.index}].productPrice" value="${aProduct.productPrice}">
		            </div>
	            </td>    
	        </tr>
	        </c:forEach>
        </tbody>            
    </table>
    <p class="text-center">
		<button type="submit" class="btn btn-primary">Next</button>
	</p>
</form:form>
</div>
</body>
</html>